Himawari (Blank Note) voice patch (2010-06-06)
This patch uses voice files from the PSP release and applies them to the original 
doujin release.

*IMPORTANT*
Before applying the voice patch, please download the latest official update from
http://blank-note.sakura.ne.jp/download.html (which will produce a file called
patch.xp3 where Himawari is installed).

The voice patch consists of two files:
  patch3.xp3 (patched scripts)
  patch2.xp3 (voices)
Extract these to the Himawari directory.

This voice patch is incompatible with the encryption the Himawari uses.
Thus, for the patch to work, you must first create an unencrypted data.xp3.

To do so, first use crass (http://galcrass.blog124.fc2.com/) to extract the
raw contents of the encrypted data.xp3 file. The commandline to do this is:

crage -r -p "<Himawari_directory>\data.xp3" -O tpm1="<Himawari_directory>\data.xp2"

Do the same for patch.xp3 (the official update patch).

Next, use the kirikiri archive tool (http://kikyou.info/tvp/ - krkrrel.exe in SDK)
to rebuild an unencrypted data.xp3 and patch.xp3 from the contents extracted with crass.

Backup the original data.xp3 and patch.xp3 and replace them with the new ones. Then, 
copy the krkr.exe from the SDK into the Himawari directory. You need to use krkr.exe 
instead of ひまわり.exe for the unencrypted data.xp3 (and patches) to work.




(for the DIY-types)

----

Tools to build patch3.xp3 are included in the archive, but they require some setup to use.
The voice patch scripts require Python 3.x to be installed. Steps:

(1) Extract the PSP scenario files (mac.afs) using crass. Place the extracted (.BIP) scripts 
    in a folder called "mac" in the same directory where the scripts are located.
(2) Extract the scenario files from the original game (inside patch.xp3 after applying the 
    update patch from the official site) using crass. Copy the scenario files (ひまわり*.ks) 
    to a folder name scenario_main in the same directory where the scripts reside.
(3) Run voice_patch.bat. The patched .ks files will be placed in a directory called patch3.
(4) Copy first.ks (from the extracted patch.xp3) into the patch3 directory. Open first.ks in
    a text editor and comment out the following line (line 10 in patch version 1.23 (2010.04.20)) 
    by placing a ";" in front of it:
        @eval exp="System.inform('ファイルが破損しています。再インストールして下さい。',System.title);kag.shutdown();" cond="!tf.kaihachu || !Storages.isExistentStorage('デバッグ用ショートカット.ks2')"
(5) Use krkrrel.exe in the kirikiri SDK to build "patch3.xp3" from the patch directory.

----

If you don't want to download patch2.xp3 (voices) and instead would prefer
to extract them from the PSP version, you can use crass to extract them from
the voice.afs archive and then use vgmstream (http://hcs64.com/vgmstream.html) and
oggenc2 (http://www.rarewares.org/ogg-oggenc.php) to convert the AHX/ADX files to ogg. 
Use the same filename before the extension (e.g. convert AKA0000.AHX to AKA0000.ogg). 
Then, just use krkrrel.exe to build the ogg files into a patch2.xp3.
